using UnityEngine;

public class Fruit : Plant
{
	protected IFruitController fruitController;

	protected Vector2Int point;

	public void Begin(IFruitController fruitController, Vector2Int point)
	{
		this.fruitController = fruitController;
		this.point = point;
		Map.CreatePlant(point);
		transform.position = point.ToVector3();
		StartCoroutine(Grow());
	}

	protected override void OnEnd()
	{
		Map.DestroyPlant(point);
		fruitController.EatFruit();
		Object.Destroy(base.gameObject);
	}
}
